// 引入Service和请求头ServiceName
import { Service, ServiceName } from '@/network/http.js'
import store from '@/store/index.js' // 引入store

const api = {
  // 通过航次id获取信息
  queryDept (params) {
    return Service.get(
      `/${ServiceName}/api/external/workPlan/queryDept?id=${params}`
    )
  },
  // 新增
  addApplication (params) {
    store.commit('changeStatus', true)
    return Service.post(
      `/${ServiceName}/api/external/workPlan/addApplication`,params
    )
  },
  // 查询  （前沿，转运，后场，辅助）的机械类型
  querymachine (params) {
    return Service.get(
      `/${ServiceName}/api/external/workPlan/querymachine`
    )
  },
  // 查询机械类型为门机的编号
  queryMachineTypeOne (params) {
    return Service.get(
      `/${ServiceName}/api/external/workPlan/queryMachineTypeOne`
    )
  },
  // 查询主列表
  queryApplication (params) {
    return Service.get(
      `/${ServiceName}/api/external/workPlan/queryApplication`,{params}
    )
  },
  // 删除
  deletebyid (params) {
    return Service.delete(
      `/${ServiceName}/api/external/workPlan/deletebyid?id=${params}`
    )
  },
  // 删除
  updateApplication (params) {
    return Service.put(
      `/${ServiceName}/api/external/workPlan/updateApplication`,params
    )
  },
}
export default api